<div class="fui-page fui-page-current " ng-if="pagedata.op=='list'">
    <div class="fui-header">
        <div class="fui-header-left">
            <a class="back" ng-click="goback()"></a>
        </div>
        <div class="title">我的维权申请</div>
    </div>
    <div class="fui-content navbar">
        
        <div class="fui-tab fui-tab-warning" id="tab">
            <a ng-repeat="(k,v) in pagedata.status" ng-click="pagedata.params.status=k;tool.get_list('/order.refund/getlist/status='+k,true)" ng-class="{'active':pagedata.params.status==k}" href="javascript:;">{{v}}</a>
			
        </div>
		<div class="fui-list-group order-item" style="padding-bottom:0.5rem" ng-repeat="item in pagedata.list">
				<div class="fui-cell-group noborder">
					<div class="fui-cell">
						<div class="fui-cell-info">关联订单号: {{item.ordersn}}</div>
						<div class="fui-cell-remark">
							{{pagedata.status[item.status]}}
						</div>
					</div>
					<div class="fui-list">
						<div class="fui-cell-info"><i class="icon jinyunicon icon-trade" style="font-size: 0.65rem"></i> 申请退款金额：{{item.price}}</div>
					</div>
					<div class="fui-list">
						<div class="fui-cell-info"><i class="icon jinyunicon icon-clock" style="font-size: 0.65rem"></i> 申请时间：{{item.createtime}}</div>
					</div>
					<div class="fui-list" ng-if="item.reason">
						<div class="fui-cell-info"> <i class="icon jinyunicon icon-trade" style="font-size: 0.65rem"></i> 审核说明：{{item.reason}}</div>
					</div>
				</div>				
            <div class="fui-list-group-title lineblock opblock">
				<span class="status noremark" style="float:right">
					<div ng-if="item.status == 1" class="btn btn-sm btn-default-o order-delete" href="javascript:" ng-click="access_json('//send/id='+item.id)">退货商品发货</div>
					<div ng-if="item.status == 0" class="btn btn-sm btn-danger-o order-finish" href="javascript:" ng-click="post({id:item.id},'jy_weishop/order.refund/cancel/')">取消退款申请</div>
					
				</span>
            </div>
        </div>
		<div class='infinite-loading' style="display:none" id="loading_show"><span class='fui-preloader'></span><span class='text'> 正在加载...</span></div>
		<div class="content-empty" ng-show="pagedata.list.length == 0 || !pagedata.list">
		  <i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">暂时没有退货申请！</p>
		</div>
	</div>
	<div ng-include="sys_html('common/_menu')"></div>
	<script>
	if(scope.pagedata.op=='list'){
		scope.tool.get_list('/order.refund/getlist/status='+scope.pagedata.params.status,true);
		scope.scroll_bottom=function(){
			scope.tool.get_list('/order.refund/getlist/status='+scope.pagedata.params.status);
		}
	}
	</script>
</div>
<style>
    .fui-footer .btn{
        border-radius: 1rem;
        margin-top: .6rem;
        min-width: 4.1rem;
    }
    .fui-footer{
        padding-right: .6rem;
    }
    .fui-footer .btn.btn-default-o {
        border-color: #666;
        color: #666;
    }
    .fui-title.r-group{
        background: #f3f3f3;
        margin: 0;
        padding: .5rem .6rem;
    }
    .fui-cell-group .fui-cell.noborder:before{
        border:0;
    }
</style>
<div class="fui-page fui-page-current" ng-if="pagedata.op=='apply'">
<div class="fui-header">
   
    <div class="title">退款申请</div>
    <div class="fui-header-right">&nbsp;</div>
</div>
<div class='fui-content  navbar'>
    <div class="fui-cell-group">
        
        <div class="fui-cell">
            <div class="fui-cell-label">退款说明</div>
            <div class="fui-cell-info c000" >
                <input type="text" class='fui-input' placeholder="选填" ng-model="pagedata.item.content"/>
            </div>
        </div>

    <div  class="fui-cell r-group">
        <div class="fui-cell-label">退款金额</div>
        <div class="fui-cell-info c000" style="display: -webkit-box;display: -webkit-flex;display: -ms-flexbox;display: flex;-webkit-box-align: center;-webkit-align-items: center;-ms-flex-align: center;align-items: center;">
            ￥<input type="number" id="price" value="{{pagedata.item.price}}" class='fui-input' placeholder="请输入需要退的金额" ng-model="pagedata.item.price" />
        </div>


    </div>
    <div ng-if="pagedata.order.status!=1" class="fui-cell">
        <div class="fui-cell-label">上传凭证</div>
        <div class="fui-cell-info">
            <ul class="fui-images fui-images-sm" id="images">
				<div ng-repeat="image in pagedata.item.images track by $index">
                
                <li style="background-image:url({{tomedia(image)}})" class="image image-sm"><span class="image-remove"><i class="icon icon-close"></i></span></li>
				</div>

            </ul>
            <div  class="fui-uploader fui-uploader-sm refund-container-uploader" ng-click="images(pagedata.item,'images')">
            
        </div>

    </div>
</div>

<div class='fui-title r-group'>
<span class='text-danger'>*提示:您可退款的最大金额为￥{{pagedata.order.endprice}}<span ng-if="pagedata.order.status>1">(扣除运费{{pagedata.order.dispatchprice || '0.00'}})</span></span>
</div>

</div>


</div>
<div class='fui-footer text-right'>
    <a class='btn btn-sm btn-danger-o btn-submit' ng-click="post(pagedata.item,pagedata.op)">提交申请</a>
    <a class="btn btn-sm btn-default-o back" ng-click="goback()">取消</a>
</div>
</div>
<div class='fui-page' id='page-refund-express' ng-if="pagedata.op=='send'">
    <div class="fui-header">
       
        <div class="title">退货</div>
        <div class="fui-header-right">&nbsp;</div>
    </div>
    <div class='fui-content margin'>
       
        <div class="fui-cell-group">
            <div class='fui-cell-title'>填写快递单号</div>
            <div class="fui-cell">
                <div class="fui-cell-label">快递公司</div>
                <div class="fui-cell-info"><select ng-model="pagedata.item.com">
                    <option value="0" data-name="其他快递">其他快递</option>
                    <option ng-repeat="value in pagedata.express_types" value="{{value.name}}" >{{value.name}}</option>
                </select></div>
            </div>
            <div class="fui-cell">
                <div class="fui-cell-label">快递单号</div>
                <div class="fui-cell-info"><input type="text" ng-model="pagedata.item.sn" class='fui-input' max="50"/></div>
            </div>
        </div>

    </div>
    <div class='fui-footer text-right'>
        <div class="btn btn-sm btn-danger-o" id='express_submit'ng-click="post(pagedata.item,pagedata.op)">提交快递单号</div>
        <a class="btn btn-sm btn-default-o back" ng-click="goback()">返回</a>
    </div>
</div>
